<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>离乌人员信息登记</title>
    <meta charset="utf-8">



    <link href="../static/weiui/lib/weui.css" th:href="@{/weiui/lib/weui.css}" rel="stylesheet">
    <link href="../static/weiui/css/jquery-weui.css" th:href="@{/weiui/css/jquery-weui.css}" rel="stylesheet">
    <link href="../static/weiui/css/demos.css" th:href="@{/weiui/css/demos.css}" rel="stylesheet">

    <th:block th:include="include :: header('新增离乌申请数据')" />
    <th:block th:include="include :: datetimepicker-css" />

</head>

<body ontouchstart onload="regeocoder()">

<div class="weui-tab">
    <div class="weui-tab__bd">
        <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">

            <div class="wrapper wrapper-content animated fadeInRight ibox-content" >
                <form class="form-horizontal m" id="form-lwsq-add" style="padding-bottom: 35px">
                    <div class="form-group" style="text-align: center;font-size: 20px;font-weight: bold">
                        <span class="col-sm-12 ">离乌人员信息登记</span>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">申请人姓名：</label>
                        <div class="col-sm-8">
                            <input name="xm" minlength="2" class="form-control"placeholder="请输入姓名" type="text" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">申请人性别：</label>
                        <div class="col-sm-8">
                            <select name="xb" class="form-control "style="color: blue" th:with="type=${@dict.getType('sys_user_sex')}" required>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">年龄：</label>
                        <div class="col-sm-8">
                            <input name="by3"  class="form-control"placeholder="请输入年龄" type="number" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">申请人民族：</label>
                        <div class="col-sm-8">
                            <select name="mz" class="form-control" th:with="type=${@dict.getType('b_ry_mz')}" required>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>

                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">手机号码：</label>
                        <div class="col-sm-8">
                            <input name="sjhm" class="form-control"  placeholder="请输入您的手机号码" type="text" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">人员类型：</label>
                        <div class="col-sm-8">
                            <select name="sfjn" class="form-control"style="color: blue" th:with="type=${@dict.getType('b_rylx')}" required>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">近3天是否有发热、咳嗽等症状：</label>
                        <div class="col-sm-8">
                            <select name="styc" class="form-control "style="color: blue" th:with="type=${@dict.getType('sys_yes_no')}" required>
                                <option value="">未选择</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">证件类型：</label>
                        <div class="col-sm-8">
                            <select name="zjlx" class="form-control " style="color: blue" th:with="type=${@dict.getType('b_zjlx')}" required>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">证件号码：<span id="zjhmcz" style="color: red"></span></label>
                        <div class="col-sm-8">
                            <input name="zjhm"  minlength="10" maxlength="18" class="form-control"placeholder="请输入您的证件号码(用于身份核验)" type="text" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">入乌日期：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="rwrq" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">暂住所类型：</label>
                        <div class="col-sm-8">
                            <select onchange="isshowFJH()" id="zzslx" name="zzslx" class="form-control " th:with="type=${@dict.getType('b_zzslx')}" required>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">详细地址/隔离点：</label>
                        <div class="col-sm-8">
                            <textarea id="xxdz" name="xxdz" class="form-control" rows="3" placeholder="如宾馆/酒店名称/住所所在道路、门牌号、小区、楼栋号、单元室等" required></textarea>
                        </div>
                    </div>

                    <div class="form-group" id="fjh">
                        <label class="col-sm-3 control-label ">入住房间号：</label>
                        <div class="col-sm-8">
                            <input  name="by1" class="form-control" placeholder="房间号" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">入住时间：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="by5" class="form-control" id="by5" placeholder="yyyy-MM-dd HH:mm:ss" type="text" required>
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                    <hr/>

                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">请正确选择社区，便于社区管理人员联系</label>
                    </div>

                    <div id="element1" class="row">
                        <div class="col-sm-2">
                            <select id="quyu" class="quyu form-control m-b" data-first-title="选择区域">
                                <option value="">请选择</option>
                                <option value="天山区" selected>天山区</option>
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <select id="jiedao" class="jiedao form-control m-b" data-first-title="选择街道管委会">
                                <option value="燕儿窝街道" selected>燕儿窝街道</option>
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <select id="shequ" class="shequ form-control m-b" data-first-title="选择社区">
                                <option value="红雁池社区" selected>红雁池社区</option>
                            </select>
                        </div>
                    </div>

                    <input name="sqName" id="sqName" type="hidden"/>
                    <input name="sqCode" id="sqCode" type="hidden"/>
                    <input name="id" id="id" type="hidden"/>

                    <input name="by5" id="by5" type="hidden"/>
                    <input name="by6" id="by6" type="hidden"/>



                    <div class="form-group">
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="ck"  id="ck" type="checkbox" checked>本人承诺:以上所填写内容真实,完整,
                                如有虚假,由本人承担一切责任!
                            </div>
                        </div>
                    </div>


                    <hr/>

                    <div class="col-md-12">
                        <div class="form-group">
                            <div class="col-sm-12 " style="text-align: center;">
                                <button id="bottonsubmit" type="button" onclick="submitHandler()" class="btn btn-primary">提交</button>
                                <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
                            </div>
                        </div>
                    </div>

                </form>
            </div>


        </div>
        <div id="tab2" class="weui-tab__bd-item">

            <div class="wrapper wrapper-content animated fadeInRight ibox-content" >
                <form class="form-horizontal m" id="form-lwsq-likai" style="padding-bottom: 35px">
                    <div class="form-group" style="text-align: center;font-size: 16px;font-weight: bold">
                        <span class="col-sm-12 ">提交离乌申请</span>
                    </div>

                    <hr/>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">离乌事由：</label>
                        <div class="col-sm-8">
                            <textarea name="by2" class="form-control"placeholder="离乌事由"></textarea>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">离乌方式：</label>
                        <div class="col-sm-8">
                            <select name="lwfs" class="form-control "style="color: blue" th:with="type=${@dict.getType('b_jtfs')}" required>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group" >
                        <label class="col-sm-3 control-label">车牌号/航班号/车次号：</label>
                        <div class="col-sm-8">
                            <input name="cphm" class="form-control" placeholder="请输入您的车牌号/航班号/车次等,例:新A8888" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">预期离乌日期：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="yqlwrq" class="form-control" placeholder="yyyy-MM-dd" type="text" >
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">返程目的地：</label>
                        <div class="col-sm-8">
                            <input name="fcmdd" class="form-control"placeholder="请输入您的返程目的地" type="text" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">近期是否做过核酸检测：</label>
                        <div class="col-sm-8">
                            <select name="hsjc" class="form-control"style="color: blue" th:with="type=${@dict.getType('sys_yes_no')}" required>
                                <option value="">未选择</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">核酸检测日期：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="hsjcRq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">是否做过双抗检测：</label>
                        <div class="col-sm-8">
                            <select name="skjc" class="form-control"style="color: blue" th:with="type=${@dict.getType('sys_yes_no')}" required>
                                <option value="">未选择</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">双抗检测日期：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="skjcRq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="ck"  id="ck" type="checkbox" checked>本人承诺:以上所填写内容真实,完整,
                                如有虚假,由本人承担一切责任!
                            </div>
                        </div>
                    </div>

                </form>
            </div>
        </div>

        <div id="tab4" class="weui-tab__bd-item">

            <div class="wrapper wrapper-content animated fadeInRight ibox-content" >
                <form class="form-horizontal m" id="form-lwsq-chaxun" style="padding-bottom: 35px">
                    <div class="form-group" style="text-align: center;font-size: 16px;font-weight: bold">
                        <span class="col-sm-12 ">个人离乌申请状态查询</span>
                    </div>

                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">手机号：</label>
                            <div class="col-sm-9">
                                <input type="text"  minlength="11" maxlength="11" name="findtel" id="findtel" class="form-control" placeholder="请输入手机号码">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-12">
                        <div class="form-group">
                            <div class="col-sm-12">
                                <span id="findresult" style="font-weight: bold;font-size: 14px;color: red"></span>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-12">
                        <div class="form-group">
                            <div class="col-sm-12 " style="text-align: center;">
                                <button  type="button" onclick="jcsubmitHandler()" class="btn btn-primary">查询</button>
                            </div>
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>

    <div class="weui-tabbar">
        <a href="#tab1" class="weui-tabbar__item weui-bar__item--on">
            <div class="weui-tabbar__icon">
                <img src="../weiui/images/icon_nav_msg.png" alt="">
            </div>
            <p class="weui-tabbar__label">信息填报</p>
        </a>
        <a href="#tab2" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="./weiui/images/icon_nav_button.png" alt="">
            </div>
            <p class="weui-tabbar__label">离乌申请</p>
        </a>

        <a href="#tab4" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="./weiui/images/icon_nav_cell.png" alt="">
            </div>
            <p class="weui-tabbar__label">查询</p>
        </a>
    </div>
</div>
<script src="../static/js/xj.city.js" th:src="@{/js/xj.city.js}"></script>
<script src="../static/weiui/lib/jquery-2.1.4.js" th:src="@{/weiui/lib/jquery-2.1.4.js}"></script>
<script src="../static/weiui/lib/fastclick.js" th:src="@{/weiui/lib/fastclick.js}"></script>
<script src="../static/weiui/js/jquery-weui.js" th:src="@{/weiui/js/jquery-weui.js}"></script>
<script src="https://webapi.amap.com/maps?v=1.4.15&key=b87a9d678230dbc20c41b22eac54f95c"></script>

<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jquery-cxselect-js" />

<script th:inline="javascript">
    var prefix = ctx + "api/lwsq/lwsq"
    $("#form-lwsq-add").validate({
        focusCleanup: true,
        rules: {
            by3: {
                required: true,
                min: 0,
                max: 200
            },
            sjhm:{
                isPhone:true
            }
        },
        messages: {
            by3: {
                required:  "请输入您的年龄",
                minlength:  "年龄多大了"
            },
        },
    });

    function submitHandler() {

        if($("#shequ").val()=="" || $("#shequ").val()==null){
            $.modal.alertWarning("请选择所属社区！便于社区人员联系")
            return
        }

        if ($.validate.form()) {
            $("#sqName").val($("#shequ").find("option:selected").text())
            $("#sqCode").val($("#shequ").find("option:selected").val())
            $.operate.post(prefix+"/add",$('#form-lwsq-add').serialize(),saveCallback);
        }

    }

    //是否显示房间号
    function isshowFJH() {
        if($("#zzslx").val()=="jd"){
            $("#fjh").css("display","");
        }
        else{
            $("#fjh").css("display","none");
        }
    }

    //保存提交回调函数，保存成功后拿到id，继续提交做修改
    function saveCallback(index,msg) {
        if(index.code==0) {
            $("#id").val(index.data)
        }
        if(index.code==500) {
        }
    }

    function lksubmitHandler() {
        $.operate.save(prefix + "/edit", $('#form-lwsq-likai').serialize());
        $.modal.alertSuccess('！')
    }

    function jcsubmitHandler() {
        $.operate.get(prefix + "/findByTel?tel="+$('#findtel').val(),callb);
    }

    function callb(index){
            if(index.code==0) {
                $("#findresult").html(index.data)
            }
        if(index.code==500) {
            $("#findresult").html('请检查手机号是否输入错误，未查到数据！');

        }
    }
    $("input[name='shclsj']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='rwrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='yqlwrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='jcbgRq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='hsjcRq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='skjcRq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    layui.use('laydate', function() {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#laydate-demo-3',
            type: 'datetime',
            trigger: 'click'
        });
        laydate.render({
            elem: '#laydate-demo-4',
            type: 'datetime',
            trigger: 'click'
        });
        laydate.render({
            elem: '#by5',
            type: 'datetime',
            trigger: 'click'
        });
    });

    var data = init_xj_city_picker;

    $('#element1').cxSelect({
        selects: ['quyu', 'jiedao', 'shequ'],
        jsonName: 'name',
        jsonValue: 'code',
        jsonSub: 'children',
        data: data
    });



</script>

<script type="text/javascript">

 function regeocoder() {
     AMap.plugin('AMap.Geolocation', function() {
         var geolocation = new AMap.Geolocation({
             // 是否使用高精度定位，默认：true
             enableHighAccuracy: true,
             // 设置定位超时时间，默认：无穷大
             timeout: 10000,
             // 定位按钮的停靠位置的偏移量，默认：Pixel(10, 20)
             buttonOffset: new AMap.Pixel(10, 20),
             //  定位成功后调整地图视野范围使定位位置及精度范围视野内可见，默认：false
             zoomToAccuracy: true,
             //  定位按钮的排放位置,  RB表示右下
             buttonPosition: 'RB'
         })

         geolocation.getCurrentPosition()
         AMap.event.addListener(geolocation, 'complete', onComplete)
         AMap.event.addListener(geolocation, 'error', onError)

         function onComplete (data) {
            console.log(data.formattedAddress)
             $("#xxdz").val(data.formattedAddress)
             console.log(data.position.lat)
             console.log(data.position.lng)
         }

         function onError (data) {
             console.log(data.message)
         }
     })
    }

</script>



</body>
</html>
